package com.zzxy.springmvc12.controller;

import com.zzxy.springmvc12.po.Student;
import com.zzxy.springmvc12.po.StudentExt;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/stu")
public class StudentController {
    @RequestMapping("register")
    public String register(){
        return "/user/register";
    }
    @RequestMapping("/addStu")
    public String addStu(String username,String password){
        System.out.println(username);
        System.out.println(password);
        return "/user/userList";
    }

    @RequestMapping("/addStu1")
    public String addStu1(Student student){
        System.out.println(student);
        return "/user/userList";
    }
    @RequestMapping("/addStu2")
    public String addStu2(StudentExt ext){
      System.out.println(ext);
//        for (Student student : ext.getStudentList()){
//            System.out.println(student);
//        }
        return "/user/userList";
    }
    @RequestMapping("test")
    public String test(){
        return "forward:/register.do";
    }
    @RequestMapping("test1")
    public String test1(){
        return "redirect:/register.do";

    }
}
